﻿///*
// * TiffCompression
// * 
// * original Copyright (c) 2002, 2003 Marco Schmidt.
// * All rights reserved.
// * 
// * C# translation and update 
// * Copyright (c) Adam Sida, asida@centrum.cz
// * 
// * All rights reserved.
// */
//using System;


//namespace Petra.Gis.Geometry.Image.Tiff
//{
//  /// <summary>
//  /// represents single sample (band) of raster image which color information is stored in separated storages
//  /// sometimes traditional interleave model where eg. rgb values alters each other in bitmap is not efficient
//  /// then single color channel (or sample or band) is stored and compressed separately
//  /// this might benefit to compression
//  /// </summary>
//  public abstract class Band
//  {
//    protected int _bitsPerBand;
//    protected TiffBitmapSource _image;
//    protected Block[] _blocks;


//    public Band(TiffBitmapSource image, int bitsPerSample)
//    {
//      if (image == null)
//        throw new ArgumentException("invalid image");

//      //validate bps val
//      if (bitsPerSample < 1 || bitsPerSample > 48)
//        throw new ArgumentException("invalid bitPerSample value, must be range (1-48)");

//      if ((bitsPerSample % 8) != 0 && bitsPerSample != 1)
//        throw new ArgumentException("invalid bitPerSample value, if not = 1 then must be modulo of 8");

//      _bitsPerBand = bitsPerSample;

//      _image = image;

//      readBlocks();
//    }


//    /// <summary>
//    /// returns bitsPerSample for current band
//    /// </summary>
//    public int BitsPerBand
//    {
//      get { return _bitsPerBand; }
//    }


//    /// <summary>
//    /// returns collection of current band Blocks that contains image data pointers
//    /// </summary>
//    public Block[] Blocks
//    {
//      get { return _blocks; }
//    }


//    /// <summary>
//    /// read and create blocks from ifd tags
//    /// </summary>
//    private void readBlocks()
//    {
//      int numOffsets;

//      if(_image.TiffMetadata.IsTiled)
//        numOffsets = _image.TiffMetadata.Ifd.GetTag(Tag.TagId.TILEOFFSETS).Count;
//      else
//        numOffsets = _image.TiffMetadata.Ifd.GetTag(Tag.TagId.STRIPOFFSETS).Count;

//      _blocks = new Block[numOffsets];
//      for (int i = 0; i < numOffsets; i++)
//      {
//        //_blocks[i] = new Block(_image,(long)_image.Ifd.GetTag(Tag.TagId.STRIPOFFSETS).TagData[i]);
//        _blocks[i] = new Block(_image, i);
//      }
//    }

//  }
//}
